package com.magicode.cms.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import com.magicode.cms.common.assist.UtilPath;
import com.magicode.cms.dao.IUserMessageDao;
import com.magicode.cms.entiy.base.UserMessage;
import com.magicode.cms.service.IUserMessageService;
@Service("serviceUserMessage")
public class UserMessageServiceImpl extends BaseServiceImpl<UserMessage,IUserMessageDao> implements IUserMessageService,UtilPath{

	@Override
	public List<Map<String, Object>> getBeanInfo() {
		// TODO Auto-generated method stub
		return null;
	}
	@Autowired
	@Qualifier("daoUserMessage")
	private IUserMessageDao userMessageDao;
	@Override
	public String getHql(Map<String, String> querywhere) throws Exception {
		String hql = " from "+UserMessage.class.getName()+" "+entity_alias_name+" where 1=1";
		if(null!=querywhere && !querywhere.isEmpty()){
			if(querywhere.containsKey(field_id)){
				hql = hql+" and "+entity_alias_name+".id='"+querywhere.get(field_id)+"'";
			}
		}
		return hql;
	}

	@Override
	public List<Map<String, Object>> grid(Map<String, String> querywhere) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public IUserMessageDao getDao() throws Exception {
		// TODO Auto-generated method stub
		return userMessageDao;
	}

	public IUserMessageDao getUserMessageDao() {
		return userMessageDao;
	}

	public void setUserMessageDao(IUserMessageDao userMessageDao) {
		this.userMessageDao = userMessageDao;
	}

}
